package aml.parse.node;

import aml.runtime.Context;
import aml.runtime.Value;

public class OpPlus extends OpNode {
	@Override
	public int precedence() {
		return 10000;
	}
	
	@Override
	public Value eval(Context ctx) {
		Value a = lhs.eval(ctx);
		Value b = rhs.eval(ctx);
		Value[] args = new Value[1];
		args[0] = b;
		return a.call(ctx, "+", args);
	}

	@Override
	public String toString() {
		return "(+ " + lhs + " " + rhs + ")";
	}
}